/**
 * 
 */
package org.hotpotmaterial.codegenn2.service;

import org.hotpotmaterial.codegenn2.dto.entity.PageDTO;
import org.hotpotmaterial.codegenn2.dto.request.PageRequestDTO;
import org.hotpotmaterial.codegenn2.dto.request.PasswordRequestDTO;
import org.hotpotmaterial.codegenn2.entity.HmteamAccount;

/**
 * @author cakydeveloper
 *
 */
public interface IHmteamAccountService {
	
	/**
	 * 通过用户名查询
	 * @param username
	 * @return
	 */
	public HmteamAccount findAccountByUsername(Integer type, String username);
	
	/**
	 * 通过类型和外部id查询
	 * @param type
	 * @param externalId
	 * @return
	 */
	public HmteamAccount findAccountByTypeAndExternalId(Integer type, String externalId);
	
	/**
	 * 插入
	 * @param account
	 * @return
	 */
	public HmteamAccount insertAccount(HmteamAccount record);
	
	/**
	 * 更改
	 * @param id
	 * @param record
	 * @return
	 */
	public HmteamAccount updateAccount(Long id, HmteamAccount record);
	
	/**
	 * 分页（用户名查询）
	 * @param searchDTO
	 * @return
	 */
	public PageDTO<HmteamAccount> findAccountsByUsername(PageRequestDTO searchDTO);
	
	/**
	 * 更新密码
	 * @param id
	 * @param password
	 * @return
	 */
	public void updatePassword(Long id, PasswordRequestDTO password);
	
	/**
	 * 管理员重置密码
	 * @param id
	 * @return
	 */
	public HmteamAccount resetPassword(Long id);
	
	/**
	 * 逻辑删除
	 * @param id
	 */
	public void logicDeleteAccount(Long id);

}
